package com.atguigu.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfig {
    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI().info(new Info().title("mybatisplus3测试文档").version("1.0"));
    }

    @Bean
    public GroupedOpenApi userOpenAPI() {
        return GroupedOpenApi.builder().group("用户模块").pathsToMatch("/user/**").build();
    }

    @Bean
    public GroupedOpenApi homeOpenAPI() {
        return GroupedOpenApi.builder().group("房间模块").pathsToMatch("/home/**").build();
    }
}
